import m7Cache from './m7dicMap.js'
export default {
  install (Vue, options) {
    //  获取指定cache
    Vue.prototype.$getCache = (type, id) => {
      return m7Cache.getCache(type, id)
    }
    //  更新
    Vue.prototype.$updateCache = (type, payload) => {
      return m7Cache.updateCache(type, payload)
    }
    // 为某个缓存项，添加一条
    Vue.prototype.$addOneCache = (type, payload) => {
      return m7Cache.addOneCache(type, payload)
    }
    // 删除
    Vue.prototype.$deleteCache = (type) => {
      return m7Cache.$deleteCache(type)
    }
    //  获取所有
    Vue.prototype.$m7cache = m7Cache.getAll()
    // 坐席数据对象化
    Vue.prototype.$agentsMap = () => {
      return m7Cache.getCache('agentObj')
    }
  }
}
